﻿#region Summary

// 
// Owner : JackieHan 
// 
// Solution : Pharyngitis 
// 
// Project : TTrip.Pharyngitis.NHibernate
// 
// File : ModuleMappingUtil.cs
// 
// CopyRight : Copyright © 2010-2011 Skomart Corporation, All Rights Reserved 
// 
// Summary : 配置工具类
// 
// History : 
//			2012-03-21 11:44:29	    Create 
// 

#endregion

#region Using

using System;
using System.Collections.Generic;
using ConfOrm;
using ConfOrm.NH;

#endregion

namespace Jackie.Utility.NHibernate
{
    ///<summary>
    ///配置工具类
    ///</summary>
    public static class ModuleMappingUtil
    {
        public static IEnumerable<Type> RunModuleMapping<T>(ObjectRelationalMapper orm, Mapper mapper) where T : IModuleMapping, new()
        {
            IModuleMapping domainMapping = new T();
            domainMapping.DomainDefinition(orm);
            domainMapping.RegisterPatterns(mapper, orm);
            domainMapping.Customize(mapper);
            return domainMapping.GetEntities();
        }
    }
}